//
//  QNShowToastView.h
//  QNReuseTool
//
//  Created by rsh on 2019/10/15.
//  Copyright © 2019年 rsh. All rights reserved.
//

// MARK: 控制器中弹出提示view

#import <UIKit/UIKit.h>

typedef enum : NSUInteger {
    AnimationStyle_Detafult,
    AnimationStyle_fromBottom,
    AnimationStyle_fromTop,
    AnimationStyle_fromLeft,
    AnimationStyle_fromRight,
} AnimationStyle;

typedef enum : NSUInteger {
    HideAnimationStyle_Detafult,
    HideAnimationStyle_toBottom,
    HideAnimationStyle_toTop,
    HideAnimationStyle_toLeft,
    HideAnimationStyle_toRight,
} HideAnimationStyle;

typedef NS_OPTIONS(NSUInteger, AutoLayoutStyle) {
    AutoLayoutPosition_center = 1 << 0,
    AutoLayoutPosition_top = 1 << 1,
    AutoLayoutPosition_left = 1 << 2,
    AutoLayoutPosition_bottom = 1 << 3,
    AutoLayoutPosition_right = 1 << 4,
};

@interface QNShowToastView : UIView

-(void)showContentView:(UIView *)contentView
            fatherView:(UIView *)fatherView
           conmpletion:(void(^)())completionhandle;
//
//-(void)showOnView:(UIView *)toastSuperview
//      conmpletion:(void(^)())completionhandler;

-(void)showOnView:(UIView *)view;

-(void)hideContentView;

//内容view
@property(nonatomic,strong) UIView *contentView;

@property(nonatomic,strong) UIView *fatherView;

//动画数组 animation for contentview
@property(nonatomic,strong) NSArray *animationArr;

//default is YES
@property(nonatomic,assign) AnimationStyle animationStyle;

//default is HideAnimationStyle_Detafult
@property(nonatomic,assign) HideAnimationStyle hideAnimationStyle;

//default is YES
@property(nonatomic,assign) BOOL userTouchActionEnable;

//default is YES
@property(nonatomic,assign) BOOL addShowAnimation;

//default is YES
@property(nonatomic,assign) BOOL addHideAnimation;

//default is NO
@property(nonatomic,assign) BOOL useAutoLayout;

//default is AutoLayoutPositon_center
@property(nonatomic,assign) AutoLayoutStyle layoutPositon;

//default is [[UIColor blackColor] colorWithAlphaComponent:0.75];
@property(nonatomic,strong) UIColor *backColor;

//popview's Insets in superview. default is zero;
@property(nonatomic,assign) UIEdgeInsets  popViewInsets;

//弹窗消失时销毁contentview default is YES
@property(nonatomic,assign) BOOL destoryWhenHideContentView;

@property(nonatomic,copy) void(^showCompletionBlock)(void);

@property(nonatomic,copy) void(^hideCompletionBlock)();

@end


/**
 *简单基本介绍：
 
 //赖加载view
-(QNShowToastView *)showToastView{
     if (!_showToastView) {
         _showToastView = [[QNShowToastView alloc]init];
         _showToastView.animationStyle = AnimationStyle_fromBottom;
         _showToastView.userTouchActionEnable = YES;
     }
     return _showToastView;
}
 
 
 
 
 //把要展示的view添加到showToastView 中

 if (!self.payView) {
     self.payView = [[NetCarPayView alloc]init];
     self.payView.payMethodArr = @[@(TransMethodAlipay),@(TransMethodWeixin)];
     
     __weak typeof(self) weakself = self;
     self.payView.closeBlock = ^{
         [weakself.showToastView hideContentView];
     };
     self.payView.payBlock = ^(TransMethod method) {
         [weakself.showToastView hideContentView];
         [weakself payWithMethod:method];
     };
 }
 
 UIWindow *window = [UIApplication sharedApplication].keyWindow;
 [self.showToastView showContentView:self.payView fatherView: window conmpletion:^{

 }];
 

 
 *
 *
 **/
